<template>
  <div>
    <div class="table-page-search-wrapper">
      <div>
        <a-form layout="inline">
          <know-topnav />
        </a-form>
      </div>
    </div>
    <company-profile />
   
  </div>
</template>

<script>
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
import moment from 'moment'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/zkxhKnowledge'
import CompanyProfile from '../../components/knowlage/companyProfile'
import DiseaseKnowledgelist from '../../components/knowlage/diseaseKnowledgelist'
import KnowTopnav from '../../components/knowlage/knowtopnav'

export default {
  name: 'DepsettingModal',
  mixins: [JeecgListMixin],
  components: {
    CompanyProfile,
    DiseaseKnowledgelist,
    KnowTopnav
  },
  //这是疾病知识页面
  data() {
    return {
      search: '',
      columns: [],
      searchAll: '',
      detailSearchArr: [],
      enLetters: 'abcdefghjklmnopqrstwxyz',
      selectData: ['zhang', 'li'],
      // 请求参数
      url: {
        list: '/knowledge/knoCgOwner/getDepAll',
        listseach: '/knowledge/knoCgOwner/list',
        fuzzysearch: '/es/searchFull/getSearchDiseaseOrDrugsAll',
        getSearchSecondLeveList: '/es/searchFull/getSearchSecondLeveList',
        searchDetail: '/es/searchFull/getSearchSecondLeveList',
        querySearchList: '/knowledge/knoCgOwner/querySearchList'
      },
      options: [],
      value: [],
      list: [],
      loading: false,
      states: ['张洪亮']
    }
  },
  created() {
    console.log('787897978897')
    console.log(this.$route.params.id)
  },
  computed: {},

  mounted() {
    this.list = this.states.map(item => {
      return { value: `${item}`, label: `${item}` }
    })
  },
  methods: {
    remoteMethod(query) {
      getAction(this.url.querySearchList, { searchType: 1, filed: query }).then(res => {
        if (res.success) {
          console.log('8888888888888888888888888')
          console.log(res.result)
          let soon = []
          for (var i = 0; i < res.result.length; i++) {
            soon.push(res.result[i].disname)
          }
          this.states = soon
          console.log(this.states)
          console.log(this.value)
          this.list = this.states.map(item => {
            return { value: `${item}`, label: `${item}` }
          })
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
      if (query !== '') {
        this.loading = true
        setTimeout(() => {
          this.loading = false
          this.options = this.list.filter(item => {
            return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1
          })
        }, 200)
      } else {
        this.options = []
      }
    },
    detailSearch(e) {
      getAction(this.url.searchDetail, { searchId: e, searchType: 1 }).then(res => {
        if (res.success) {
          console.log('777777777777')
          console.log(res.result)
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    missTime(e) {
      getAction(this.url.fuzzysearch, { searchName: e, searchType: 1 }).then(res => {
        if (res.success) {
          console.log('5438')
          console.log(this.selectData.A)
          this.selectData = res.result
          console.log(this.token)
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    searchOne(e) {
      if (this.value.length == 0) {
        getAction(this.url.fuzzysearch, { searchName: '科', searchType: 1 }).then(res => {
          if (res.success) {
            console.log('lalalalalalalalalal')
            console.log(res)
            this.fuzzySearch = res.result
            console.log('132123123231324132123')
          }
          if (res.code === 510) {
            this.$message.warning(res.message)
          }
          this.loading = false
        })
      } else {
        getAction(this.url.fuzzysearch, { searchName: '"' + this.value[0] + '"', searchType: 1 }).then(res => {
          if (res.success) {
            console.log('66666666666666666')
            console.log(this.value)
            this.fuzzySearch = res.result
          }
          if (res.code === 510) {
            this.$message.warning(res.message)
          }
          this.loading = false
        })
      }
    },
    forSearch(e) {
      getAction(this.url.fuzzysearch, { searchName: e, searchType: 1, feildType: 1 }).then(res => {
        if (res.success) {
          console.log('5438')
          console.log(res)
          console.log(this.searchAll)
          this.fuzzySearch = res.result
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
  }
}
</script>

<style lang="less" scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/knowledge.less';
@import '../../assets/less/knowlagepublic.less';

.classification-details {
  width: 100%;
  background-color: #fff;
  margin-top: 8px;
  padding-top: 20px;
  padding-left: 32px;
  padding-bottom: 30px;

  .classification-details-inner {
    width: 1124px;
    border: 1px #ebeef5 solid;

    .classification-details-inner-a {
      display: flex;
      height: 75px;
      line-height: 75px;
      border-bottom: 1px dashed #ebeef5;

      li {
        list-style: none;
        font-size: 14px;
        margin-right: 30px;
        color: #333;
      }

      li:hover {
        color: #38c3c8;
      }

      span {
        font-size: 32px;
        width: 112px;
        font-weight: 400;
        text-align: center;
        color: #38c3c8;
      }
    }

    .classification-details-inner-a:last-child {
      border-bottom: none;
    }
    .classification-details-inner-a {
      .hover-change {
        color: #333;
        p:hover {
          color: #38c3c8;
        }
      }
    }
  }
}
.btn {
  border: none;
  background-color: #fff;
}
#components-back-top-demo-custom .ant-back-top {
  bottom: 100px;
}
#components-back-top-demo-custom .ant-back-top-inner {
  height: 40px;
  width: 40px;
  line-height: 36px;
  color: #ccc;
  text-align: center;
  font-size: 20px;
  border: 1px solid #ccc;
}
#components-back-top-demo-custom .ant-back-top-inner:hover {
  color: #aaa;
  border: 1px solid #aaa;
}
//input获取焦点，border专用
.inp:focus {
  border: 1px solid #38c3c8;
}
.inp:hover {
  border: 1px solid #38c3c8;
}
.inp::selection {
  background-color: #38c3c8;
  color: #fff;
}
.table-page-search-wrapper{
  margin-left: 10px !important;
}
</style>